﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace SIMS.Common.Converter
{
    public class SexConverter2 : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || parameter == null)
                return false;
            return value.ToString() == parameter.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value == true && parameter.ToString() == "1")
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
